    $(document).ready(function(){
        $("#side a").each(function(i){
            if ($(this).hasClass('cur')) {
                loadContent($(this).attr('href'));
            }
            //alert('d');
            $(this).click(function(e){
                var e = e || window.event;
                //alert(e);
                e.preventDefault();
                e.stopPropagation()
                if (!$(this).hasClass('cur')) {
                    $("#side a").each(function(i){
                        if ($(this).hasClass('cur')) {
                            $(this).removeClass('cur');
                        }
                    });
                    $(this).addClass('cur');
                }
                loadContent($(this).attr('href'), $(this).attr('target'));
                return false;
            });
        });
        if (document.getElementById('quickRequest')) {
            $("#quickRequest").change(function(){
                var i = this.options.selectedIndex;
                var op = this.item(i);
                if ($(op).attr('target') == '_blank') {
                    location.href = $(this).val();
                }
                else {
                    loadContent($(this).val());
                }
            });
        }
        $("#top_menu ul li a").click(function(){
        	var $that = $(this);
            $.get("/selectMode",{mode: $(this).attr("mode")}, 
			 function(result){
                if (result === true) {
                	$("#top_menu ul li a").each(function(){
                        $(this).removeClass("cur");
                    });
                    $that.addClass("cur");
                }
            });
            return false;
        });
    });
    function resizeIframe(iframe){
        iframe.style.height = iframe.contentDocument.body.scrollHeight + 'px';
        var title = '';
        if (iframe.contentDocument.getElementById('subject')) {
            var title = iframe.contentDocument.getElementById('subject').innerHTML;
        }
        if (title.length > 4) {
            $("#subject").html(title);
        }
    }
    
    function loadContent(src, t){
        if (t && t == '_top') {
            window.top.location.href = src;
        }
        else {
            $("#iframe").attr('src', src);
        }
    }
